/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [Rectangle.java]
 * Creation Date        [12-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_02_gui.sketchpad.shape;

import java.awt.Color;
import java.awt.Graphics;

/**
 * 矩形
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Rectangle implements Shape {

	// 矩形左上角的坐标
	private int x, y;
	// 矩形的宽度和高度
	private int width, height;

	private Color rectangleColor;

	public Rectangle() {
		super();
	}

	public Rectangle(int x, int y, int width, int height, Color rectangleColor) {
		super();
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.rectangleColor = rectangleColor;
	}

	@Override
	public void paint(Graphics g) {
		g.setColor(rectangleColor);
		g.drawRect(x, y, width, height);
	}

}
